//
//  SNShopModel.m
//  app
//
//  Created by 王少宁 on 15/8/19.
//  Copyright (c) 2015年 hdaren. All rights reserved.
//

#import "SNShopModel.h"


@implementation SNShopModel

- (instancetype)initWithDict:(NSDictionary *)dict
{
    if ([super init]) {
        
        NSMutableArray * mutableArray = [NSMutableArray array];
        
        NSDictionary * user_infoDic = dict[@"user_info"];
        if (user_infoDic && user_infoDic.allKeys.count) {
            _user_infoModel = [SNShopUserInfoModel modelWithDict:user_infoDic];
        }
        
        
        NSArray * brandsadArray = dict[@"brandsad"];
        _brandsadModel = [SNShopBrandsadModel modelWithArray:brandsadArray];
        [mutableArray addObject:_brandsadModel];
        
        
        NSMutableArray * activitiesIconArray = dict[@"activitiesIcon"];
        _activitiesIconModel = [SNShopActivitiesIconModel modelWithArray:activitiesIconArray];
        [mutableArray addObject:_activitiesIconModel];
        
        
        NSArray * notices_listArray = dict[@"notices_list"];
        _notices_listModel = [SNShopNoticesListModel modelWithArray:notices_listArray];
        [mutableArray addObject:_notices_listModel];
        
        
        NSArray * themeActsListArray = dict[@"themeActsList"];
        _themeActsListModel = [SNShopThemeActsListModel modelWithArray:themeActsListArray];
        [mutableArray addObject:_themeActsListModel];
        
        
        NSArray * activitiesListArray = dict[@"activitiesList"];
        _activitiesListModel = [SNShopActivitiesListModel modelWithArray:activitiesListArray];
        [mutableArray addObject:_activitiesListModel];
        
        
        NSArray * hotProductArray = dict[@"hotProduct"];
        _hotProductModel = [SNShopHotProductModel modelWithArray:hotProductArray];
        [mutableArray addObject:_hotProductModel];
        
        _dataSourceArray = mutableArray;
    }
    return self;
}

+ (instancetype)modelWithDict:(NSDictionary *)dict
{
    return [[self alloc] initWithDict:dict];
}

@end



























